﻿using System;
using System.Collections;
using System.Linq;

namespace NMapper
{
    public interface IDatabaseInstance<out TDatabase> : IDisposable
    {
        TDatabase Db { get; }
    }

    public abstract class DatabaseAdapter<TDatabase>
    {
        public abstract IDatabaseInstance<TDatabase> CreateDatabase();
        public abstract void Insert(TDatabase db, IEnumerable entities);
        public abstract IQueryable<TDbEntity> GetTable<TDbEntity>(TDatabase db);
        public abstract void Commit(TDatabase db);
    }
}